

var data={
    arr:[{
        name:2
    }]
}

// 结论：数组内部改变，不会触发 set
//      但是数组内部读取，会触发 get
Object.defineProperty(data,"arr",{
    enumerable: true,
    configurable: true,
    get(){

        console.log('get--->');
        
        return [{
            name:2
        }]
    },

    set(newVal){

        console.log('arr--newVal',newVal);
        
    }
})


// data.arr.push(8888)

console.log('data.arr[0]',data.arr[0].name);
